﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing;

namespace UIDesigner
{
    class ImageManager
    {
        private List<Type> m_typeList = new List<Type>();
        private ImageList m_imageList = null;

        public ImageManager()
        {
        }

        public int Add(Type type, Image img)
        {
            int i = 0;
            for (i = 0; i < m_typeList.Count; i++)
            {
                if (type == m_typeList[i])
                {
                    return i;
                }
            }
            m_imageList.Images.Add(img);
            m_typeList.Add(type);
            return i;
        }

        internal void Init(ImageList imageList)
        {
            m_imageList = imageList;
            for (int n = 0; n < imageList.Images.Count; n++)
            {
                m_typeList.Add(this.GetType());
            }
        }
    }
}
